home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / dev / c / c_v43_dt.rea < prev    next >
Text File  |  1997-03-02  |  8KB  |  177 lines

  1. Short:    How: OS3 V40/43 PicDatatype in 100% C
  2. Author:   Andreas_Kleinert@t-online.de
  3. Uploader: Andreas_Kleinert@t-online.de
  4. Type:     dev/c
  5.  
  6.  
  7.   samplePNM.datatype and source-code V43.5 (25.1.97)
  8.   (C) 1996-97 by Andreas R. Kleinert. All rights reserved.
  9.  
  10.   ---
  11.   This small sample datatype source code demonstrates, how to completely
  12.   write an Amiga OS 3 datatype (V40/V43) without any assembler stubs
  13.   or compiler/linker tricks in PURE C source code (currently SAS/C-based:
  14.   see Aminet:dev/c/CLib37x.LHA on how to adjust for some other compilers).
  15.  
  16.   You may e.g. use this example source code to write more portable
  17.   Amiga OS 3 datatypes to allow easier porting of these
  18.   to other Amiga OS-derived operating systems, or the native
  19.   OS of an upcoming PowerPC Amiga.
  20.  
  21.   Translate your 68k-assembler datatype startup-codes smartly
  22.   to C by simply using this source-code as an advice how to do it.
  23.  
  24.  
  25.   As a common case, a datatype of class picture, supporting
  26.   PNM-PGM (P5) and PNM-PPM (P6) has been used as an example.
  27.  
  28.   With picture.datatype V40-42 only PGM is supported,
  29.   and with picture.datatype V43 reading of PPM is offered as well,
  30.   while encountering an PGM file under V43 causes a fallback to V40
  31.   routines (could have been done differently, but was not necessary
  32.   here just for demonstration).
  33.  
  34.   For testing this datatype, simply use a tool from the NetPBM package
  35.   (or maybe for example a tool supporting superview.library) and save
  36.   a graphics in the binary PGM or PPM format (P5/P6 of the PNM series).
  37.  
  38.   Then install this datatype and try loading the file via MultiView.
  39.   Should work fine.
  40.  
  41.   ---
  42.   Feel free to use this source for own projects.
  43.  
  44.   It is allowed to be spread and distributed anywhere, as far
  45.   as my consent is concerned.
  46.  
  47.   Amiga Technologies, or the current owner of the technologie,
  48.   is allowed to always put this source on their newest
  49.   Developer CD-ROM.
  50.  
  51.   Thanks and credits will always be appreciated - for example,
  52.   you MAY, but NEED NOT:
  53.   give me credits in your program's docs, send me keyfiles for
  54.   your programs using the library, and so on.
  55.   But that's simply voluntarily.
  56.  
  57.   This work was only roughly inspired by David Junod's original
  58.   example source codes for datatypes.
  59.  
  60.    _________________________________________________________
  61.   |      You may reach me the following way.                |
  62.   |    Send bug-reports, money or whatever to:              |
  63.   |---------------------------------------------------------|
  64.   |        * SuperView Development & Registration *         |
  65.   |          * DRAFU Development & Registration *           |
  66.   |       * Image Engineer Registration Site Europe *       |
  67.   |                                                         |
  68.   |                                                         |
  69.   |                  PerSuaSiVe SoftWorX                    |
  70.   |                                                         |
  71.   |                  Andreas R. Kleinert                    |
  72.   |                  Sandstrasse 1                          |
  73.   |                  D-57072 Siegen                         |
  74.   |                  Germany, Europe                        |
  75.   |                                                         |
  76.   | Any snail mail to the old address will still be routed. |
  77.   |                                                         |
  78.   |                  Phone:  +49-271-22869 also FAX + AM    |
  79.   |                          +49-271-22838                  |
  80.   |                                                         |
  81.   |                  Weekdays after 17.00h.                 |
  82.   |                                                         |
  83.   |         When calling via phone you may leave a message, |
  84.   |         if I'm not available - but don't expect me      |
  85.   |         calling back to USA, Australia, ... since       |
  86.   |         german phone rates are HIGHLY expensive.        |
  87.   |_________________________________________________________|
  88.  
  89.     http://home.t-online.de/home/Andreas_Kleinert/
  90.  
  91.   eMail:
  92.  
  93.         Please send binaries via ARK@COB.wwbnet.de, and keep
  94.         them smaller than 16 KB. Please think twice before
  95.         sending them - my postbox is not unlimited in size.
  96.  
  97.            - Fido    Andreas Kleinert 2:2457/350.18
  98.            - Usenet
  99.                      Andreas_Kleinert@superview.ftn.sub.org  (Fido-Gate)
  100.                      Andreas_Kleinert@t-online.de            (T-Online)
  101.                      ARK@COB.wwbnet.de                       (Z-Netz)
  102.                      ARK@amigaworld.com                      (AmigaWorld)
  103.  
  104.            - If nothing else works, try one of these public
  105.              Fido-Usenet gateways:
  106.  
  107.                In Germany:
  108.                  Andreas_Kleinert@p18.f350.n2457.z2.fido.sub.org
  109.  
  110.                From USA or elsewhere:
  111.                  Andreas_Kleinert@p18.f350.n2457.z2.fidonet.org
  112.  
  113.         Please note, that the "superview.ftn.sub.org"
  114.         domain will perhaps be renamed soon
  115.  
  116.  History:
  117.  
  118.  V43.5 (25.1.97) :  - now explicitely checks for DTA_SourceType == DTST_File
  119.                     - small changes
  120.                     - updated email information
  121.  
  122.  V43.4 (3.1.97) :   - fixed PRI entry in resident part
  123.                     - slightly changed SCOPTIONS
  124.                     - fixed some style things (APTR and library casts)
  125.                     - fixed a bug: bitmap would not have been freed
  126.                       on temporary-buffer allocation error
  127.                     - added note about library opening to L_OpenLibs()
  128.  
  129.  V43.3 (30.11.96) : - added SAS/C specific Ctrl-C disabling code
  130.                     - made some workarounds compiler sensitive
  131.                     - redone all with SAS/C V6.57
  132.  
  133.  V43.2 (3.11.96)  : - there was a FreeBitMap() call missing (oops)
  134.                     - it's samplePNM.dt, not samplePNG.dt ;-)
  135.  
  136.  V43.1 (25.10.96) : - added picture datatype V43 support
  137.                     - thus added support for 24 Bit PPM (P6),
  138.                       since PGM only has 256 grayscales
  139.                     - thus renamed to samplePNM.datatype
  140.  
  141.  V40.3 (13.9.96)  : - fixed more "style" things
  142.  
  143.  V40.2 (5.9.96)   : - fixed some "style" things
  144.  
  145.  V40.1 (2.9.96)   : - first release
  146.  
  147.  ---
  148.  All mentioned trademarks are subjects to their owners.
  149.  
  150.  
  151. ============================= Archive contents =============================
  152.  
  153. Original  Packed Ratio    Date     Time    Name
  154. -------- ------- ----- --------- --------  -------------
  155.       86      76 11.6% 25-Oct-96 16:26:52 +PGM
  156.      467     279 40.2% 25-Oct-96 16:26:52 +PGM.info
  157.       86      76 11.6% 25-Oct-96 16:27:44 +PPM
  158.      467     279 40.2% 25-Oct-96 16:27:44 +PPM.info
  159.      107     102  4.6% 25-Oct-96 17:34:40 +CompileNote.readme
  160.      739     301 59.2% 25-Oct-96 16:17:50 +libfuncs.h
  161.      835     388 53.5% 25-Oct-96 16:28:52 +samplePNM.datatype.info
  162.      245     174 28.9% 25-Oct-96 17:35:00 +SCOPTIONS
  163.      408     156 61.7% 25-Oct-96 16:23:58 +smakefile
  164.      119     104 12.6% 25-Oct-96 16:23:58 +smakefile.wth
  165.     3947    1178 70.1% 30-Nov-96 13:34:44 +StartUp.c
  166.     1100     578 47.4% 30-Nov-96 13:35:12 +StartUp.o
  167.      795     364 54.2% 03-Jan-97 15:21:22 +classbase.h
  168.     4728    2443 48.3% 25-Jan-97 14:01:18 +samplePNM.datatype
  169.    11773    2912 75.2% 25-Jan-97 13:59:24 +libfuncs.c
  170.     3500    1914 45.3% 25-Jan-97 14:01:16 +libfuncs.o
  171.     4782    1435 69.9% 25-Jan-97 14:00:50 +LibInit.c
  172.     1476     810 45.1% 25-Jan-97 14:01:04 +LibInit.o
  173.     4728    2443 48.3% 25-Jan-97 14:01:18 +samplePNM.datatype
  174.     6118    2417 60.4% 25-Jan-97 14:02:26 +README
  175. -------- ------- ----- --------- --------
  176.    46506   18429 60.3% 27-Jan-97 01:16:02   20 files
  177.